package com.snowy.framework.exception;

/**
 * 统一异常枚举
 *
 * @author Melody
 *
 */
public enum ExceptionENU {
	//-------------RuntimeException 01***----------------//
	ArrayIndexOutOfBoundsException("01001", "数组索引越界异常"),
	ArithmeticException("01002", "算术条件异常"),
	SecurityException("01003", "安全性异常"),
	IllegalArgumentException("01004", "非法参数异常"),
	ArrayStoreException("01005", "数组中包含不兼容的值异常"),
	NegativeArraySizeException("01006", "数组长度为负异常"),
	ClassCastException("01007", "类型转换异常类"),
	NullPointerException("01008", "空指针异常"),
	NumberFormatException("01009", "数据格式化异常"),
	StringIndexOutOfBoundsException("01010", "字符串索引超出范围异常"),
	//-------------IOException 02***----------------//
	IOException("02001", "IO流异常"),
	EOFException("02002", "文件已结束异常"),
	FileNotFoundException("02003", "文件未找到异常"),
	LoadException("02004", "文件加载异常"),
	//-------------其他 03***----------------//
	SQLException("03001", "执行SQL错误"),
	NoSuchFieldException("03002", "字段未找到异常"),
	NoSuchMethodException("03003", "方法未找到异常"),
	IllegalAccessException("03004", "访问权限异常"),
	InstantiationException("03005", "实例化异常"),
	ClassNotFoundException("03006", "找不到类异常"),
	TimeoutException("03007", "阻塞操作超时异常"),
	BadStringOperationException("03008", "无效的字符串异常"),
	//-------------mybatis 04***----------------//
	BindingException("04001", "配置文件映射异常"),
	PropertyNotFoundException("04002", "属性未找到异常"),
	MyBatisSystemException("04003", "系统错误"),
	//-------------Redis 05***----------------//
	JedisConnectionException("05001", "Redis连接异常"),
	CacheException("05002", "Redis的key不符合设计规范错误"),
	SerializationException("05003", "序列化失败"),
	//-------------Redis 05***----------------//
	SocketTimeoutException("05001", "Socket连接超时异常"),
	ConnectTimeoutException("05002", "Server连接超时异常"),
	SSLHandshakeException("05003", "SDK证书错误异常"),
	CertificateException("05003", "SSL握手异常"),
	ResourceAccessException("05003", "证书不不受信任"),
	ClientProtocolException("05003", "客户端请求异常"),
	;

	private String code;

	private String msg;


	ExceptionENU(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
